import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import demo from '@/components/mydwmo'
import cmp1 from '@/components/cmp1'

import iview1 from '@/components/iview1'

import r1 from '@/components/router1'
import rp1 from '@/components/rp'

import bigview from '@/components/bigview'

Vue.use(Router)

export default new Router({
  mode: 'history', // 不使用hash模式
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/demo',
      name: 'demo',
      component: demo
    },
    {
      path: '/cmp1',
      name: 'cmp1',
      component: cmp1
    },
    {
      path: '/iview1',
      name: 'iview1',
      component: iview1
    },
    {
      path: '/r234',
      name: 'r456',
      component: r1,
      children: [{
        path: 'rp4',
        component: rp1
      }]
    },
    {
      path: '/bigview',
      name: 'bigview',
      component: bigview
    },
    {
      path: '*',
      name: 'error_404',
      component: () => import('@/view/error-page/404.vue')
    }
  ]
})
